import { getCouponList, cartList } from "@src/api/coupon";
import dayjs from "dayjs";

Component({
  data: {
    pageNum: 1,
    pageSize: 10,
    loading: false,
    listData: []
  },
  methods: {
    onLoad() {
      // this.fetchData(2)
      this.fetchData(3)
    },
    fetchData(status) {
      let data = {
        status: 3,
        cardType: null
      };
      this.setData({ loading: true })
      cartList(data).then(res => {
        this.setData({ loading: false })
        let list = res.data;
        this.setData({ listData: list })
      }).catch(() => {
        this.setData({ loading: false })
      })
    },

  }
})
